﻿/// <reference path="../lib/require.js" />
define(['lib/knockout-2.3.0', 'lib/jquery-2.0.3.min'], function (ko, $) {
    var $ = window.$,
        _menu = ko.observableArray([
            { Title: 'About', Link: 'about.html' },
            { Title: 'Contact', Link: 'contact.html' }
        ]),
        _navigate = function (link, callback) {
            var returnObj = {},
                linkVM = link.split('.')[0];

            $.get('view/' + link, function (data) {
                returnObj.view = data;
                require(['viewmodel/' + linkVM], function (vm) {
                    returnObj.viewmodel = vm;
                    callback(returnObj);
                });
            });
        };
    return {
        navigate: _navigate,
        menu: _menu
    };
});